package com.wwwc.admin.web.filter;

import java.io.*;
import java.sql.Timestamp;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public final class IndexFilter implements Filter {
    private FilterConfig filterConfig = null;

    public void init(FilterConfig filterConfig) throws ServletException {
        this.filterConfig = filterConfig;
    }
    
    public void destroy() {
        this.filterConfig = null;
    }
 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 
	throws IOException, ServletException {
	String user_ip = request.getRemoteAddr();
	
	if(user_ip == null || !user_ip.startsWith("192.168.1.103")) {
	    return;
	}

	chain.doFilter(request, response);	
	System.out.println("IndexFilter:admin from :"+user_ip);
	return;
    }
}
